using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace RiceShop.Models
{
    /// <summary>
    /// SKU实体类
    /// </summary>
    [Table("SKU")]
    public class SKU
    {
        /// <summary>
        /// SKU ID
        /// </summary>
        [Key]
        [Column("skuId")]
        public long SkuId { get; set; }

        /// <summary>
        /// 商品SPU ID
        /// </summary>
        [Column("spuId")]
        public long SpuId { get; set; }

        /// <summary>
        /// SKU编码
        /// </summary>
        [Column("code")]
        [StringLength(50)]
        public string? Code { get; set; }

        /// <summary>
        /// 规格值
        /// </summary>
        [Column("specValues")]
        [StringLength(500)]
        public string SpecValues { get; set; } = string.Empty;

        /// <summary>
        /// 图片
        /// </summary>
        [Column("image")]
        [StringLength(500)]
        public string? Image { get; set; }

        /// <summary>
        /// 售价
        /// </summary>
        [Column("salePrice", TypeName = "decimal(18,2)")]
        public decimal SalePrice { get; set; }

        /// <summary>
        /// 划线价格
        /// </summary>
        [Column("linePrice", TypeName = "decimal(18,2)")]
        public decimal? LinePrice { get; set; }

        /// <summary>
        /// 成本价
        /// </summary>
        [Column("costPrice", TypeName = "decimal(18,2)")]
        public decimal? CostPrice { get; set; }

        /// <summary>
        /// 市场价
        /// </summary>
        [Column("marketPrice", TypeName = "decimal(18,2)")]
        public decimal? MarketPrice { get; set; }

        /// <summary>
        /// 库存数量
        /// </summary>
        [Column("stock")]
        public int? Stock { get; set; }

        /// <summary>
        /// 已售数量
        /// </summary>
        [Column("sold")]
        public int? Sold { get; set; }

        /// <summary>
        /// 重量(克)
        /// </summary>
        [Column("weight")]
        public int? Weight { get; set; }

        /// <summary>
        /// 积分
        /// </summary>
        [Column("points")]
        public int? Points { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("createTime")]
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [Column("updateTime")]
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        [Column("isDeleted")]
        public bool? IsDeleted { get; set; }

        /// <summary>
        /// 关联的商品
        /// </summary>
        public virtual Good? Good { get; set; }
    }
}